/**
 * Created by Administrator on 2017/11/8 0008.
 */
define(["jquery","template","bbcare","fu/app/comm/comm"],function($,template,$bb,$comm){
    var servers = {};
    var URL = $bb.baseUrl("imgCollection");
    /*
     * 查询影像设备列表：
     * */
    servers.getEquipList = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryEquipByClassId",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                if(data.success){
                    callback(data,infoParams);
                }
            }
        });
    };
    /*
     * 查询影像文件：
     * */
    servers.getImgList = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryImg",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                if(data.success){
                    callback(data,infoParams);
                }
            }
        });
    };
    /*
    * 获取影像带签名的url;
    *
     */
    servers.getImgSignatureUrl = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/getImgFileSignUrl",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                if(data.success){
                    callback(data,infoParams);
                }
            }
        });
    };
    /*
    * 手动上传接口：
     */
    servers.imgUploadManual = function(params,callback,infoParams){
        var sessionId = $bb.getSessionStorage("sessionId");
        $bb.ajax({
            url: URL + "imgCollection/upload/uploadWebImg?sessionId=" + sessionId,
            processData: false,  // 告诉jQuery不要去处理发送的数据
            contentType: false,
            data:params,
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };
    /*
    * 查询到的图片关联到具体患者：//自动
    * 
     */
    servers.imgUploadAuto = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/addAssImgUser",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    * 删除图片与具体患者的关联：
    * 
     */
    servers.imgDel  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/removeAssImgUser",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    *  保存裁剪后的新图片：
    * 
     */
    servers.imgCutOut_toSave  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/upload/saveClipImg",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    * 影像文件的标记添加/修改  
     *
     */
    servers.imgMark_modifyAndAdd = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/saveImgMark",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    * 图片标记删除：
     *
     */
    servers.imgMark_toDeal  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/removeImgMark",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };
    /*
    * 查询影像文件标记内容及其答案：
     */
    servers.imgMarkContentAndAnswer  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryImgMarkData",
            data:JSON.stringify({
                "data":params
            }),
            async: false,
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    * 查询影像文件标记记录
     */
    servers.imgMarkHistory  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryImgMarkRecord",
            data:JSON.stringify({
                "data":params
            }),
            async: false,
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    *   根据相关条件查询影像文件标记模板
     */
    servers.imgMarkTemplate  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryMarkTempl",
            data:JSON.stringify({
                "data":params
            }),
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };

    /*
    *   根据相关条件查询影像文件标记模板的问卷内容：
     */
    servers.imgMarkTemplateContent  = function(params,callback,infoParams){
        $bb.ajax({
            url: URL + "imgCollection/imgMark/queryMarkTemplCont",
            data:JSON.stringify({
                "data":params
            }),
            async: false,
            success: function (data) {
                callback(data,infoParams);
            }
        });
    };
    return servers ;
});